Skip to content

feat: replace GCS TestPermissions health check with probe object round-trip#4683

Open
antonio-altr wants to merge 2 commits into
OffchainLabs:masterfrom
antonio-altr:feat/replace-gcs-testpermissions
Open

feat: replace GCS TestPermissions health check with probe object round-trip#4683
antonio-altr wants to merge 2 commits into
OffchainLabs:masterfrom
antonio-altr:feat/replace-gcs-testpermissions

Conversation

@antonio-altr
Copy link
Copy Markdown
Contributor

@antonio-altr antonio-altr commented May 5, 2026

Problem

The GCS HealthCheck uses bucket.IAM().TestPermissions() to verify that the daserver service account has the required storage permissions. However, GCP's testIamPermissions API has a documented limitation: it does not evaluate conditional IAM bindings. When permissions are granted via a condition (e.g. resource.name.startsWith("projects/_/buckets/my-bucket/objects/my-prefix/")), the API always returns an empty list — even if the service account can actually read and write to the bucket.

Fix

Replace the TestPermissions call with an actual write/read/delete round-trip on a small probe object at <objectPrefix>.health-check-probe. This exercises the real permissions path and works correctly for both unconditional and conditional IAM bindings.

Notes

  • The probe object is written and immediately deleted on every health check invocation
  • No change to the public API or configuration
  • The sort and go-cmp imports are removed as they are no longer used

@antonio-altr antonio-altr force-pushed the feat/replace-gcs-testpermissions branch 2 times, most recently from 4a76db2 to f784fe3 Compare May 20, 2026 08:40
…vice.GetByHash

context.Canceled is expected when the ReaderTimeoutWrapper or RedundantStorageService
returns early because a faster inner service already succeeded. Logging it at
ERROR level is misleading — the overall call succeeded.
@antonio-altr antonio-altr force-pushed the feat/replace-gcs-testpermissions branch from f784fe3 to e7e0331 Compare May 20, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant